package Chapter2.Comparing.c6;

public class GenericTest2 {
    public static <T extends Comparable<T>> T maximum(T x,T y, T z){
        T max = x;
        if(y.compareTo(max)>0) {
            max=y;
        }
        if (z.compareTo(max)>0) {
            max = z;
        }
        return  max;
    }

    public static void main(String args[]) {
        System.out.printf("%d,%d,%d 中最大数为 %d\n\n",3,4,5,maximum(6,4,5));
        System.out.println("apple".compareTo("pear"));
    }

}
